home *** CD-ROM | disk | FTP | other *** search
/ A.C.E. 1 / ACE CD 1.iso / files / utils / rexxplus.dms / in.adf / install.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1992-06-23  |  19.1 KB  |  884 lines

  1. /* Install:                                */
  2. /*                                    */
  3. /*    is used to install the REXX PLUS Compiler. It prompts the user  */
  4. /*    as to the install options wanted and installs the product as    */
  5. /*      requested.                            */
  6.  
  7. /* $VER: RexxPlusInstall 1.27 (03.02.92) */
  8. signal on error
  9. signal on syntax
  10. trace o
  11. address command
  12. t = 'Replace'
  13. in.t = 'in'
  14. t = 'Copy'
  15. in.t = 'to'
  16. call addlib("rexxsupport.library",0,-30,0)
  17.  
  18. continue = 0
  19. visible = '9b2070'x
  20. invisible = '9b302070'x
  21. if (checklib("rexxsupport.library 999 999"))
  22. then call addlib("rexxsupport.library",0,-30,0)
  23. if (checklib("rexxarplib.library 999 999"))
  24. then call addlib("rexxarplib.library",0,-30,0)
  25.  
  26. arplib = pos('rexxarplib.library',show('l')) ~= 0
  27. suplib = pos('rexxsupport.library',show('l')) ~= 0
  28.  
  29. call close(STDIN)
  30. call close(STDOUT)
  31. call open(STDIN,'*','r')
  32. call open(STDOUT,'*','w')
  33.  
  34. 'RexxPlus:checklib >ram:work dos.library'
  35. call open('work','ram:work','r')
  36. line = readln('work')
  37. call close('work')
  38. parse var line ver20 .
  39. if (ver20 > 36)
  40. then do
  41.     say
  42.     ver20 = 1    /* 2.0 opsys */
  43.     do while cnt ~= 2 & cnt ~= 4 & abbrev('QUIT',cnt,1) = 0
  44.         say 'Enter number of colors on the screen. (2, 4, Quit)?'
  45.         parse upper pull cnt .
  46.         end
  47.     if abbrev(cnt,'QUIT',1)
  48.     then signal rexxexit
  49.     else if cnt = 2
  50.          then do
  51.         forground0 = '9b'x||'0;31;40m'||'9b'x||'3;31;40m'
  52.         forground1 = '9b'x||'0;31;40m'||'9b'x||'1;31;40m'
  53.         forground2 = '9b'x||'0;31;40m'
  54.         forground3 = '9b'x||'0;31;40m'||'9b'x||'3;31;40m'
  55.         end
  56.          else do
  57.         forground0 = '9b'x||'0;30;40m'
  58.         forground1 = '9b'x||'0;31;40m'
  59.         forground2 = '9b'x||'0;32;40m'
  60.         forground3 = '9b'x||'0;33;40m'
  61.         end
  62.     end
  63. else do
  64.     ver20 = 0    /* 1.3 opsys */
  65.     forground0 = '9b'x||'0;30;40m'
  66.     forground1 = '9b'x||'0;31;40m'
  67.     forground2 = '9b'x||'0;32;40m'
  68.     forground3 = '9b'x||'0;33;40m'
  69.     end
  70.  
  71. say
  72. say
  73.  
  74. if ~(checklib("rexxplslib.library 1 27")) 
  75. then if ~(userbool("Re-install same release of REXX PLUS?"))
  76.      then signal rexxexit
  77.  
  78. if (userbool("Copy Dates from install disk?"))
  79. then clone = 'CLONE'
  80. else clone = ''
  81.  
  82. if suplib
  83. then do 
  84.     workdir = showlist('A','WORK')
  85.     makedir = showlist('A','REXX')
  86.     rxdir = showdir('SYS:','D')
  87.     rxdir = upper(rxdir)
  88.     if (find('REXX',rxdir) ~= 0)
  89.     then rxdir = 'SYS:REXX'
  90.     else do
  91.         if workdir
  92.         then do
  93.             rxdir = showdir('WORK:','D')
  94.             rxdir = upper(rxdir)
  95.             if (find('REXX',rxdir) ~= 0)
  96.             then rxdir = 'WORK:REXX'
  97.             else rxdir = ''
  98.             end
  99.         else rxdir = ''
  100.         end
  101.  
  102.     makedir = showlist('A','RPDIR')
  103.     rpdir = showdir('SYS:','D')
  104.     rpdir = upper(rpdir)
  105.     if (find('RPDIR',rpdir) ~= 0)
  106.     then rpdir = 'SYS:RPDIR'
  107.     else do
  108.         rpdir = 'SYS:RPDIR'
  109.         if workdir
  110.         then do
  111.             rpdir = showdir('WORK:','D')
  112.             rpdir = upper(rpdir)
  113.             if (find('RPDIR',rpdir) ~= 0)
  114.             then rpdir = 'WORK:RPDIR'
  115.             else rpdir = 'WORK:RPDIR'
  116.             end
  117.         end
  118.     end
  119. else do
  120.     rxdir = 'SYS:REXX'
  121.     rpdir = 'SYS:RPDIR'
  122.     makedir = 0
  123.     workdir = 0
  124.     end
  125.  
  126. if ~(exists(rpdir))
  127. then do
  128.     if (userbool("Make Directory" rpdir"?"))
  129.     then do
  130.         'MAKEDIR' rpdir
  131.         say 'Directory' rpdir 'Made.'
  132.         end
  133.     else
  134.         if (userbool("Use Some other name?"))
  135.         then do
  136.             rpdir = uservalue("Enter the name of the Directory")
  137.             if ~(exists(rpdir))
  138.             then 'MAKEDIR' rpdir
  139.             say 'Directory' rpdir 'Made.'
  140.             end
  141.     end
  142.  
  143.  
  144. rpcmd = ''
  145. if (userbool("Install Compiler Commands (REXXPLUS, RPStart, RPHi)?"))
  146. then do
  147.     rpinfo = userbool("Install REXX PLUS Icons?"||,
  148.             '0a'x||"    (small icons will be installed to same location as commands)")
  149.  
  150.     if (userbool("Install Compiler Commands to C:?"))
  151.     then do
  152.         rpcmd = 'C:'
  153.         end
  154.     else do
  155.         rpcmd = uservalue("Enter path to install REXX PLUS Commands")
  156.  
  157.         if (right(rpcmd,1) ~= ':') &,
  158.            (right(rpcmd,1) ~= '/')
  159.         then rpcmd = rpcmd'/'
  160.             
  161.         do while ~exists(rpcmd)
  162.             say "Path" rpcmd "does not exist"
  163.             rpcmd = uservalue("Enter path to install REXX PLUS Commands")
  164.             if (right(rpcmd,1) ~= ':') &,
  165.                (right(rpcmd,1) ~= '/')
  166.             then rpcmd = rpcmd'/'
  167.             end
  168.         end        
  169.     rpcmd = upper(rpcmd)
  170.  
  171.     if CheckCopy(rpcmd,'RexxPlus')
  172.     then do
  173.         call copyrep("RexxPlus:",rpcmd,'RexxPlus')
  174.         if rpinfo 
  175.         then if exists(rpcmd'RexxPlus.info')
  176.              then do
  177.             if (userbool("Replace" rpcmd'RexxPlus.info?'))
  178.             then do
  179.                 call copyrep("RexxPlus:",rpcmd,'RexxPlus2.info','RexxPlus.info')
  180.                 end
  181.             end
  182.              else do
  183.                 call copyrep("RexxPlus:",rpcmd,'RexxPlus2.info','RexxPlus.info')
  184.                 end
  185.         end
  186.             
  187.     if ver20
  188.     then do 
  189.         if CheckCopy('SYS:WBStartup/','RPStart')
  190.         then do
  191.             rpstart = 'SYS:WBStartup/'
  192.             call copyrep("RexxPlus:c/",rpstart,'RPStart')
  193.             if exists(rpstart'RPStart.info')
  194.             then do
  195.                 if (userbool("Replace" rpstart "RPStart.info"))
  196.                 then do
  197.                     call copyrep("RexxPlus:",rpstart,'RPStart2.info','RPStart.info')
  198.                     end
  199.                 end
  200.             else do
  201.                 call copyrep("RexxPlus:",rpstart,'RPStart2.info','RPStart.info')
  202.                 end
  203.             end
  204.         end
  205.  
  206.     if rpstart = 'RPSTART'
  207.     then if CheckCopy(rpcmd,'RPStart')
  208.          then do
  209.         call copyrep("RexxPlus:c/",rpcmd,'RPStart')
  210.         if rpinfo 
  211.         then if exists(rpcmd'RPStart.info')
  212.              then do
  213.             if userbool('Replace' rpcmd'RPStart.info?')
  214.             then do
  215.                 call copyrep("RexxPlus:",rpcmd,'RPStart2.info','RPStart.info')
  216.                 end
  217.             end
  218.              else do
  219.             call copyrep("RexxPlus:",rpcmd,'RPStart2.info','RPStart.info')
  220.             end
  221.         end
  222.  
  223.     if CheckCopy(rpcmd,'RPHi')
  224.     then do
  225.         call copyrep("RexxPlus:c/",rpcmd,'RPHi')
  226.         if rpinfo 
  227.         then if exists(rpcmd'RPHi.info')
  228.              then do
  229.             if userbool('Replace' rpcmd'RPHi.info?')
  230.             then do
  231.                 call copyrep("RexxPlus:",rpcmd,'RPHi2.info','RPHi.info')
  232.                 end
  233.             end
  234.              else do
  235.                 call copyrep("RexxPlus:",rpcmd,'RPHi2.info','RPHi.info')
  236.                 end
  237.         end
  238.  
  239.     if exists('C:hi')
  240.     then do
  241.         if (userbool("Replace C:HI with RPHi?"))
  242.         then do
  243.             say 'Replacing HI with RPHi.'
  244.             'COPY RexxPlus:c/RPHi to C:HI' clone
  245.             end
  246.         end
  247.  
  248.     if exists(rxdir'hi')
  249.     then do
  250.         if (userbool("Replace' rxdir'HI with RPHi?"))
  251.         then do
  252.             say 'Replacing HI with RPHi.'
  253.             'COPY RexxPlus:c/RPHi to' rexx'HI' clone
  254.             end
  255.         end
  256.  
  257.     if exists(rpcmd'hi') & rpcmd ~= 'C:'
  258.     then do
  259.         if (userbool("Replace "rpcmd"HI with RPHi?"))
  260.         then do
  261.             say 'Replacing HI with RPHi.'
  262.             'COPY RexxPlus:c/RPHi to 'rpcmd'HI' clone
  263.             end
  264.         end
  265.     end
  266.  
  267. if (userbool("Install BLink?"))
  268. then do
  269.     if CheckCopy('C:','BLink')
  270.     then do
  271.         blcmd = 'C:'
  272.         call copyrep("RexxPlus:Public/c/",blcmd,'BLink')
  273.         end
  274.     else do
  275.         blcmd = uservalue("Enter path to install BLink")
  276.  
  277.         if (right(blcmd,1) ~= ':') &,
  278.            (right(blcmd,1) ~= '/')
  279.         then blcmd = blcmd'/'
  280.             
  281.         do while ~exists(blcmd)
  282.             say "Path" blcmd "does not exist"
  283.             rpcmd = uservalue("Enter path to install BLink")
  284.             if (right(blcmd,1) ~= ':') &,
  285.                (right(blcmd,1) ~= '/')
  286.             then blcmd = blcmd'/'
  287.             end
  288.         call copyrep("RexxPlus:Public/c/",blcmd,'BLink')
  289.         end        
  290.  
  291.     end
  292.  
  293. libsdir = 'LIBS:'
  294. if (userbool("Install rexxplslib.library?"))
  295. then do
  296.     if CheckCopy(libsdir,'rexxplslib.library')
  297.     then do
  298.         libsdir = 'LIBS:'
  299.         call copyrep("RexxPlus:libs/",libsdir,'rexxplslib.library')
  300.         end
  301.     else
  302.         if (userbool("Copy rexxplslib.library to Another Directory?"))
  303.         then do
  304.             libsdir = uservalue("Enter the name of the Directory")
  305.             if right(libsdir,1) ~= ':' &,
  306.                right(libsdir,1) ~= '/'
  307.             then libsdir = libsdir'/'
  308.  
  309.             if exists(libsdir)
  310.             then do
  311.                 call copyrep("RexxPlus:libs/",libsdir,'rexxplslib.library')
  312.                 end
  313.             end
  314.     end
  315.  
  316. libdir = 'LIB:'
  317.  
  318. libpath = 0
  319. if suplib
  320. then do 
  321.     if workdir
  322.     then libdir = 'WORK:LIB'
  323.     else libdir = 'SYS:LIB'
  324.     if showlist('A','LIB') then libdir = 'LIB:'
  325.     if libdir ~= 'LIB:'
  326.     then do
  327.         if (userbool("Create directory for object library?"))
  328.         then do
  329.             wrkdir = uservalue("Enter Directory name to create or return for '"libdir"'")
  330.             if wrkdir ~= ''
  331.             then libdir = wrkdir
  332.             if right(libdir,1) = ':' | right(libdir,1) = '/'
  333.             then do
  334.                 t = right(libdir,1);
  335.                 libdir = left(libdir,length(libdir)-1)
  336.                 end
  337.             else t = '/'
  338.             libpath = 1
  339.             if ~(exists(libdir))
  340.             then 'MAKEDIR' libdir
  341.             libdir = libdir||t
  342.             end
  343.         end
  344.     end
  345.  
  346. if exists(libdir'rexxplus.lib')
  347. then do
  348.     copy = 'Replace'
  349.     copyc = 'Replac'
  350.     end
  351. else do
  352.     copy = 'Copy'
  353.     copyc = 'Copy'
  354.     end
  355.  
  356. if (userbool("Install Object library 'RexxPlus.lib'?"))
  357. then do
  358.     if CheckCopy(libdir,'RexxPlus.lib')
  359.     then do
  360.         call copyrep("RexxPlus:lib/",libdir,'rexxplus.lib')
  361.         end
  362.     else
  363.         if (userbool( "Copy rexxplus.lib to Another Directory?"))
  364.         then do
  365.             libdir = uservalue("Enter the name of the Directory")
  366.             if right(libdir,1) ~= ':' &,
  367.                right(libdir,1) ~= '/'
  368.             then libdir = libdir'/'
  369.  
  370.             if exists(libdir)
  371.             then do
  372.                 call copyrep("RexxPlus:lib/",libdir,'rexxplus.lib')
  373.                 end
  374.             end
  375.     end
  376.  
  377. if (userbool("Copy Support Libraries to "libsdir"?"||,
  378.     '0a'x||"     arp.library"||,
  379.     '0a'x||"     rexxplsextnd.library"||,
  380.     '0a'x||"     rexxmathlib.library"||,
  381.     '0a'x||"     rexxarplib.library"||,
  382.     '0a'x||"     disreq.library"||,
  383.     '0a'x||"     rexxapp.library"||,
  384.     '0a'x||"     rx_intui.library"||,
  385.     '0a'x||"     screenshare.library"))
  386. then do
  387.  
  388.     libc = 0
  389.     if (checklib("rexxplsextnd.library 1 27"))
  390.     then do
  391.         libc = libc+1
  392.         if (userbool(copy "rexxplsextnd.library (release 1.27)" in.copy libsdir"?"))
  393.         then do
  394.             call copyrep("RexxPlus:libs/",libsdir,'rexxplsextnd.library')
  395.             end
  396.         end
  397.  
  398.     if (checklib("rexxmathlib.library 1 31"))
  399.     then do
  400.         libc = libc+1
  401.         if (userbool(copy "rexxmathlib.library (release 1.31)" in.copy libsdir"?"))
  402.         then do
  403.             call copyrep("RexxPlus:Public/libs/",libsdir,'rexxmathlib.library')
  404.             end
  405.         end
  406.  
  407.     call checklib("exec.library 999 999")
  408.     vers = ver2
  409.     if (checklib("arp.library 39 1") & vers <= 33)
  410.     then do
  411.         libc = libc+1
  412.         if (userbool(copy "arp.library (release 39.1)" in.copy libsdir"?"))
  413.         then do
  414.             call copyrep("RexxPlus:Public/libs/",libsdir,'arp.library')
  415.             end
  416.         end
  417.  
  418.     if (checklib("rexxarplib.library 3 0"))
  419.     then do
  420.         libc = libc+1
  421.         if (userbool(copy "rexxarplib.library (release 3.0)" in.copy libsdir"?"))
  422.         then do
  423.             call copyrep("RexxPlus:Public/libs/",libsdir,'rexxarplib.library')
  424.             end
  425.         end
  426.  
  427.     rx_intui = '0'
  428.     if (checklib("rx_intui.library 0 3"))
  429.     then do
  430.         libc = libc+1
  431.         if (userbool(copy "rx_intui.library (release 0.3)" in.copy libsdir"?"))
  432.         then do
  433.             rx_intui = '1'
  434.             call copyrep("RexxPlus:Public/libs/",libsdir,'rx_intui.library')
  435.             end
  436.         end
  437.  
  438.     if (checklib("disreq.library 0 1"))
  439.     then do
  440.         libc = libc+1
  441.         if (userbool(copy "disreq.library (release 0.1)" in.copy libsdir"?"))
  442.         then do
  443.             call copyrep("RexxPlus:Public/libs/",libsdir,'disreq.library')
  444.             end
  445.         end
  446.  
  447.     if (checklib("rexxapp.library 0 4"))
  448.     then do
  449.         libc = libc+1
  450.         if (userbool(copy "rexxapp.library (release 0.4)" in.copy libsdir"?"))
  451.         then do
  452.             call copyrep("RexxPlus:Public/libs/",libsdir,'rexxapp.library')
  453.             end
  454.         end
  455.  
  456.     if (checklib("screenshare.library 1 52"))
  457.     then do
  458.         libc = libc+1
  459.         if (userbool(copy "screenshare.library (release 1.52)" in.copy libsdir"?"))
  460.         then do
  461.             libc = libc+1
  462.             call copyrep("RexxPlus:Public/libs/",libsdir,'screenshare.library')
  463.             end
  464.         end
  465.  
  466.     if (libc = 0)
  467.     then say "All support libraries are at current release."
  468.     else say "Support libraries installed."
  469.     end
  470.  
  471. libi. = ''
  472. host. = 0
  473. lib.1 = "rpamigalibhost.library"
  474. host.1 = "1"
  475. lib.2 = "rpapig.library"
  476. lib.3 = "rpgenloc rexx port.library"
  477. host.3 = "1"
  478. lib.4 = "rpquicksortport.library"
  479. host.4 = "1"
  480. lib.5 = "rprexxarplib.library"
  481. lib.6 = "rprexxdb.library"
  482. lib.7 = "rprexxmathlib.library"
  483. lib.8 = "rprexxplsextnd.library"
  484. lib.9 = "rprexxrmf.library"
  485. lib.10 = "rprexxsupport.library"
  486. lib.11 = "rprxgen.library"
  487. call checklib("rx_intui.library",0,0)
  488. lib.12 = "rprx_intui00.library"
  489. if ser >= 3 
  490. then lib.12 = "rprx_intui03.library"
  491. libi.12 = "rprx_intui.library"
  492. lib.13 = "rprx_tools.library"
  493. host.13 = "1"
  494. lib.14 = "rptoasterarexx.port.library"
  495. host.14 = "1"
  496. lib.15 = "rprexxserdev.library"
  497. lib.16 = "rprexxextra.library"
  498. lib.17 = "rprexxhs.library"
  499. lib.0 = 17
  500.  
  501. lib = ''
  502. do i = 1 to lib.0
  503.     if libi.i = '' then libi.i = lib.i
  504.     lib = lib||'0a'x||'    '||libi.i
  505.     end
  506.  
  507. lib = ''
  508. do i = 1 to lib.0
  509.     if exists(libsdir||substr(libi.i,3))
  510.     then do
  511.         host.i = 2
  512.         lib = lib||'0a'x||'    '||libi.i
  513.         end
  514.     else if exists(libsdir||libi.i)
  515.          then do
  516.         lib = lib||'0a'x||'    '||libi.i
  517.         host.i = 2
  518.         end
  519.     end
  520.  
  521. if lib ~= ''
  522. then do
  523.     if (userbool('Install "rp" Libraries supporting those in 'libsdir"?"||lib))
  524.     then do i = 1 to lib.0
  525.         if host.i = 2
  526.         then do
  527.             host.i = 0
  528.             call CopyRep("RexxPlus:libs/",libsdir,lib.i,libi.i)
  529.             end
  530.         end
  531.     end
  532.  
  533. lib = ''
  534. do i = 1 to lib.0
  535.     if host.i = 1
  536.     then do
  537.         host.i = 2
  538.         lib = lib||'0a'x||'    '||libi.i
  539.         end
  540.     else host.i = 0
  541.     end
  542.  
  543. if lib ~= ''
  544. then do
  545.     if (userbool('Install "rp" Libraries supporting Hosts to 'libsdir"?"||lib))
  546.     then do i = 1 to lib.0
  547.         if host.i = 2
  548.         then do
  549.             host.i = 0
  550.             call CopyRep("RexxPlus:libs/",libsdir,lib.i,libi.i)
  551.             end
  552.         end
  553.     end
  554.  
  555. if (userbool("Modify startup-sequence?"))
  556. then do
  557.     startup = uservalue("Enter name of startup or return for 's:startup-sequence'")
  558.     if startup = ''
  559.     then startup = 's:startup-sequence'
  560.     do while ~exists(startup) & ~exists('s:'startup)
  561.         say startup 'not found.'
  562.         startup = uservalue("Enter name of startup")
  563.         end
  564.  
  565.     if exists('s:'startup)
  566.     then startup = 's:'startup
  567.  
  568.     path = ''
  569.     assign = ''
  570.     start = ''
  571.     libasn = ''
  572.  
  573.     libdir = upper(libdir)
  574.     if libdir ~= '' &,
  575.        libdir ~= 'LIB:'
  576.     then do
  577.         if libpath
  578.         then say "ASSIGN for LIB: may already be present."
  579.         do while libasn = ''
  580.             if userbool("Add Assign for LIB: to startup-sequence?")
  581.             then do
  582.                 libwrk = strip(libdir,'t','/')
  583.                 libasn = 'ASSIGN LIB:' libwrk
  584.                 libasn = uservalue("Enter assign for LIB: or return for '"libasn"'")
  585.                 if libasn = '' then libasn = 'ASSIGN LIB:' libdir
  586.                 if ~(userbool("Are you sure "libasn"?"))
  587.                 then libasn = ''
  588.                 end
  589.             else leave
  590.             end
  591.         end
  592.  
  593.     if makedir
  594.     then say "PATH and ASSIGN for RPDIR: may already be present."
  595.     do while assign = ''
  596.         if (userbool("Add Assign for RPDIR: to startup-sequence?"))
  597.         then do
  598.             libwrk = strip(rpdir,'t','/')
  599.             assign = 'ASSIGN RPDIR:' libwrk
  600.             assign = uservalue("Enter assign for RPDIR: or return for '"assign"'")
  601.             if assign = '' then assign = 'ASSIGN RPDIR:' rpdir
  602.             if ~(userbool("Are you sure "assign"?"))
  603.             then assign = ''
  604.             end
  605.         else leave
  606.         end
  607.  
  608.     do while path = ''
  609.         if (userbool("Add to the Path RPDIR: in the startup-sequence?"))
  610.         then do
  611.             path = 'PATH RPDIR:'
  612.             path = uservalue("Enter path to add or return for '"path"'")
  613.             if path = '' then path = 'PATH RPDIR:'
  614.             if ~(userbool("Are you sure "path"?"))
  615.             then path = ''
  616.             end
  617.         else leave
  618.         end
  619.  
  620.     if rpstart = 'RPSTART'
  621.     then if (userbool("Add RPStart for environment startup to startup-sequence?"))
  622.          then do
  623.         start = 'RPStart'
  624.         end
  625.  
  626.     if start ~= '' | assign ~= '' | path ~= ''
  627.     then do
  628.         say 'Reading File for correct placement.'
  629.         if (open('startup',startup,'A'))
  630.         then do
  631.             wbseek = 0
  632.             call seek('startup',0,'B')
  633.             do while ~eof('startup')
  634.                 lineno = seek('startup',0,'C')
  635.                 line = readln('startup')
  636.                 parse upper value line with a b c
  637.                 if a = 'LOADWB' | a = 'ENDCLI'
  638.                 then do
  639.                     wbseek = lineno
  640.                     i = 1
  641.                     line.0 = line
  642.                     do while ~eof('startup')
  643.                         line.i = readln('startup')
  644.                         i = i +1
  645.                         end
  646.                     leave
  647.                     end
  648.  
  649.                 if a = 'ASSIGN' & b = 'LIB:'
  650.                 then do
  651.                     say line 'found.'
  652.                     say libasn 'not added.'
  653.                     libasn = ''
  654.                     end
  655.  
  656.                 if a = 'ASSIGN' & b = 'RPDIR:'
  657.                 then do
  658.                     say line 'found.'
  659.                     say assign 'not added.'
  660.                     assign = ''
  661.                     end
  662.  
  663.                 if a = 'PATH' & b = 'RPDIR:'
  664.                 then do
  665.                     say line 'found.'
  666.                     say assign 'not added.'
  667.                     assign = ''
  668.                     end
  669.  
  670.                 if find('RPSTART',a) ~= 0
  671.                 then do
  672.                     say line 'found.'
  673.                     say start 'not added.'
  674.                     start = ''
  675.                     end
  676.  
  677.                 end
  678.  
  679.             if wbseek~= 0 then call seek('startup',wbseek,'B')
  680.  
  681.             if libasn ~= ''
  682.             then do
  683.                 if ~ commandtest(libasn)
  684.                 then do
  685.                     say libasn 'Added.'
  686.                     call writeln('startup',libasn)
  687.                     end
  688.                 else do
  689.                     say 'Error with "'libasn'".'
  690.                     say '"'libasn'" not added.'
  691.                     end
  692.                 end
  693.  
  694.             if assign ~= ''
  695.             then do
  696.                 if ~ commandtest(assign)
  697.                 then do
  698.                     say assign 'Added.'
  699.                     call writeln('startup',assign)
  700.                     end
  701.                 else do
  702.                     say 'Error with "'assign'".'
  703.                     say '"'assign'" not added.'
  704.                     end
  705.                 end
  706.  
  707.             if path ~= ''
  708.             then do
  709.                 if ~ commandtest(path)
  710.                 then do
  711.                     say path 'Added.'
  712.                     call writeln('startup',path)
  713.                     end
  714.                 else do
  715.                     say 'Error with "'path'".'
  716.                     say '"'path'" not added.'
  717.                     end
  718.                 end
  719.  
  720.             if start ~= ''
  721.             then do
  722.                 if ~ commandtest(rpcmd||start)
  723.                 then do
  724.                     say start 'Added.'
  725.                     call writeln('startup',rpcmd||start)
  726.                     end
  727.                 else do
  728.                     say 'Error with "'start'".'
  729.                     say '"'start'" not added.'
  730.                     end
  731.                 end
  732.  
  733.             if wbseek ~= 0
  734.             then do j = 0 to i-1
  735.                 call writeln('startup',line.j)
  736.                 end
  737.             end
  738.         end
  739.  
  740.     end
  741.  
  742. start = 0
  743. if suplib
  744. then do 
  745.     start = showlist('P','RPControl')
  746.     end
  747.  
  748. if start
  749. then do
  750.     if userbool("Restart REXX PLUS Environment?")
  751.     then do
  752.         say '1. enter the shell.'
  753.         say '2. enter the command rxc.'
  754.         say '3. enter the command rpstart.'
  755.         end
  756.     end
  757. else do
  758.     if userbool("Start REXX PLUS Environment?")
  759.     then do
  760.         call commandtest('RexxPlus:RPStart')
  761.         end
  762.     end
  763.  
  764. rexxexit:
  765. call writech('STDOUT','9b'x||'0;31;40m'||visible)
  766. say 'REXX PLUS Install Complete'
  767.  
  768. exit
  769.  
  770. SYNTAX:
  771. ERROR:
  772. if continue then return 1
  773. call writech('STDOUT','9b'x||'0;31;40m'||visible)
  774. say
  775. say errortext(rc)
  776. say '..........Error found at line' SIGL'...........'
  777. say '..............Install aborted...............'
  778. say 
  779. say
  780. exit
  781.  
  782. uservalue:
  783.  
  784.     parse arg a
  785.     call writech('STDOUT',forground1)
  786.     say a
  787.     options prompt forground2||'(answer/Q) >> '||,
  788.             forground1||,
  789.             visible
  790.     parse pull a
  791.     call writech('STDOUT',forground1)
  792.     b = strip(upper(a))
  793.     if abbrev("QUIT",b,1) then signal rexxexit
  794.     if abbrev("YES",b,1) then signal uservalue
  795.     if abbrev("NO",b,1) then signal uservalue
  796.     
  797.     call writech('STDOUT',forground3||invisible)
  798.     a = strip(a)
  799.     return a
  800.  
  801. userbool:
  802.  
  803. parse arg a
  804. b = 1
  805. call writech('STDOUT',forground1)
  806. do while b = 1
  807.  
  808.     say a
  809.     options prompt forground2||'(Y/N/Q) >> '||,
  810.             forground1||,
  811.             visible
  812.     parse upper pull b
  813.  
  814.     call writech('STDOUT',forground3||invisible)
  815.     b = strip(upper(b))
  816.     if abbrev("YES",b,1) then return 1
  817.     if abbrev("NO",b,1) then return 0
  818.     call writech('STDOUT',forground1||visible)
  819.     if abbrev("QUIT",b,1) then exit
  820.     b = 1
  821.     end
  822. return
  823.  
  824. checklib:
  825. parse arg lib ver rev .
  826. address command
  827. call pragma('W',"")
  828.  
  829. wrkfn = 'ram:wrkfn'pragma('I')
  830. 'RexxPlus:checklib >'wrkfn lib
  831.  
  832. call open('work',wrkfn,'r')
  833. line = strip(readln('work'))
  834. call close('work')
  835. call delete(wrkfn)
  836.  
  837. copy = "Copy"
  838. copyc = "Copy"
  839. if line = ''
  840. then if exists('libs:'lib)
  841.      then line = '0 0' lib
  842.      else return 1
  843. copy = "Replace"
  844. copyc = "Replac"
  845. parse var line ver2 rev2 libstr
  846. if ((ver = ver2) & (rev = rev2)) | ((ver = ver2) & (rev < rev2)) 
  847. then do
  848.     say '"'lib '('ver2'.'rev2')" is at current release level.'
  849.     return 0
  850.     end
  851.  
  852. call pragma('W',"WorkBench")
  853. return 1
  854.  
  855. commandtest:
  856.     continue = 1
  857.     parse arg a
  858.     signal on error
  859.     a
  860.     continue = 0
  861.     return
  862.  
  863. CopyRep: procedure expose forground1 forground2 forground3 forground0 visible invisible clone
  864.     continue = 1
  865.     parse arg dir1,dir2,fn1,fn2
  866.     if fn2 = '' then fn2 = fn1
  867.     if exists(dir2||fn2)
  868.     then say 'Replacing' dir2||fn2 'with new' fn2'....'
  869.     else say 'Copying' fn2 'to' dir2||fn2'....'
  870.     call IssueCopy
  871.     if rc ~= 0 then say forground2||'Error copying file!!'forground3||invisible
  872.     return
  873.  
  874. IssueCopy:
  875.     'COPY "'dir1||fn1'" to "'dir2||fn2'"' clone
  876.     return
  877.  
  878. CheckCopy: procedure expose forground1 forground2 forground3 forground0 visible invisible
  879. parse arg dir,fn
  880. if (exists(dir||fn))
  881. then return(userbool("Replace" dir||fn "with new" fn"?"))
  882. else return(userbool("Copy" fn "Command to" dir"?"))
  883.  
  884.